import json
import os


class Util(object):
    def open(filePath: str):
        tmpJSON = {}
        if os.path.exists(filePath):
            with open(filePath, 'r') as f:
                tmpJSON = json.load(f)
                f.close()
        return tmpJSON

    def write(filePath: str, data):
        with open(filePath, 'w') as f:
            f.write(json.dumps(data, indent=4))
        f.close()

    def json(data):
        return json.loads(data)


util = Util
